Workaround for misalignment of SubmapSlice
and Eigen data structures in heterogeneous builds
#1910
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Due to different structure alignment rules in different compilers (or even the same compiler in different compiling contexts), the
SubmapSlice
structure defined in ./cartographer/io/submap_painter.h comes intocartographer_ros
or another external project misaligned by 48 bytes because of differentsizeof()
return values (224 vs 256 bytes). This behaviour is proven when testing Cartographer compiled using Clang 15 and GCC 11.3 on Mint Linux 22 with a customized build of ROS. The reason is deeply sitting problem with implementation-defined STL shipped with different kernels and build pipelines. This pull request adds a semi-portable workaround for this issue forcing alignment ofSubmapSlice
structure to 32 bytes as is required by GCC.#pragma pack
free()
oncairo_data
#1909